	.file	"cpuinfo.c"
	.intel_syntax noprefix
	.text
	
	.globl	_func3
	.def	_func3;	.scl	2;	.type	32;	.endef
_func3:
	push	ebp
	mov 	ebp, esp
	mov 	eax, DWORD PTR [ebp+8]
	mov 	ebx, DWORD PTR [ebp+12]
	push	10
	push	20
	push	30
	call	_func4
	add		esp, 12
	pop		ebp
	ret

	.globl	_func4
	.def	_func4;	.scl	2;	.type	32;	.endef
_func4:
	push	ebp
	mov 	ebp, esp
	mov 	eax, DWORD PTR [ebp+8]
	mov 	eax, DWORD PTR [ebp+12]
	mov 	eax, DWORD PTR [ebp+16]
	pop 	ebp
	ret
	
	.globl	_cpu_id
	.def	_cpu_id;	.scl	2;	.type	32;	.endef
_cpu_id:
	push	ebp
	mov		ebp, esp
	sub		esp, 16
	
	//; DWORD PTR [ebp+8]  1st argument
	//; DWORD PTR [ebp+12] 2nd argument
	//; DWORD PTR [ebp+16] 3rd argument
	//; DWORD PTR [ebp+20] 4th argument
	
	mov		eax, DWORD PTR [ebp+8]
	cpuid
	
	mov		DWORD PTR [ebp-4], eax
	
	mov		eax, DWORD PTR [ebp+12]
	mov		DWORD PTR [eax], ebx
	
	mov		eax, DWORD PTR [ebp+16]
	mov		DWORD PTR [eax], ecx
	
	mov		eax, DWORD PTR [ebp+20]
	mov		DWORD PTR [eax], edx
	
	mov		eax, DWORD PTR [ebp-4]
	
	leave
	ret	
	
	.globl	_cpu_vendor
	.def	_cpu_vendor;	.scl	2;	.type	32;	.endef
_cpu_vendor:
	push	ebp
	mov		ebp, esp
	sub		esp, 16
	
	xor		eax, eax
	cpuid
	
	mov		eax, DWORD PTR [ebp-4]
	mov		DWORD PTR [eax], ebx
	add		eax, 4
	mov		DWORD PTR [eax], edx
	add		eax, 4
	mov		DWORD PTR [eax], ecx
	
	mov		eax, DWORD PTR [ebp-4]
	leave
	ret
	
	.globl	_cpu_stepping
	.def	_cpu_stepping;	.scl	2;	.type	32; .endef
_cpu_stepping:
	push	ebp
	mov		ebp, esp
	mov		eax, 1
	cpuid
	and		eax, 0x0f
	leave
	ret

	.globl	_cpu_model
	.def	_cpu_model;	.scl	2;	.type	32; .endef
_cpu_model:
	push	ebp
	mov		ebp, esp
	mov		eax, 1
	cpuid
	and		eax, 0xf0
	shr		eax, 4
	leave
	ret
	
	.globl	_cpu_family
	.def	_cpu_family;	.scl	2;	.type	32; .endef
_cpu_family:
	push	ebp
	mov		ebp, esp
	mov		eax, 1
	cpuid
	and		eax, 0x0f00
	shr		eax, 8
	leave
	ret
	
	.globl	_cpu_type
	.def	_cpu_type;	.scl	2;	.type	32; .endef
_cpu_type:
	push	ebp
	mov		ebp, esp
	mov		eax, 1
	cpuid
	and		eax, 0x3000
	shr		eax, 12
	leave
	ret
	
	.globl	_cpu_ext_model
	.def	_cpu_ext_model;	.scl	2;	.type	32; .endef
_cpu_ext_model:
	push	ebp
	mov		ebp, esp
	mov		eax, 1
	cpuid
	and		eax, 0x000f0000
	shr		eax, 16
	leave
	ret
	
	.globl	_cpu_ext_family
	.def	_cpu_ext_family;	.scl	2;	.type	32; .endef
_cpu_ext_family:
	push	ebp
	mov		ebp, esp
	mov		eax, 1
	cpuid
	and		eax, 0x0ff00000
	shr		eax, 20
	leave
	ret
	
	.globl	_cpu_config
	.def	_cpu_config;	.scl	2;	.type	32; .endef
_cpu_config:
	push	ebp
	mov		ebp, esp
	mov		eax, 0x00000002
	cpuid
	and		eax, 0x000000ff
	leave
	ret
	